package com.yamanyar.weebill.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yamanyar.weebill.dao.ComponentDAO;
import com.yamanyar.weebill.domain.Component;
import com.yamanyar.weebill.service.ComponentService;
/**
 * Implementation of <code>ComponentService</code> interface.
 * Created in Jun 28, 2008.
 * @see ComponentService
 * @author Kaan Yamanyar
 */
@Service
public class ComponentServiceImpl implements ComponentService {

	private ComponentDAO componentDAO;

	@Autowired
	public ComponentServiceImpl(ComponentDAO componentDAO) {
		this.componentDAO = componentDAO;
	}

	public void createNew(Component component) {
		componentDAO.persist(component);
	}

	public List<Component> findAll() {
		return componentDAO.loadAll();
	}

	public List<Component> findByName(String name) {
		return componentDAO.findByName(name);
	}

}
